<template>
  <div class="home">
   <el-container>
  <el-header>
    <h3>后台管理系统  <div class="el-icon-full-screen" @click="fullScreen()"></div></h3>
   
  </el-header>
  <el-container>
    <el-aside width="200px">
 <el-menu :default-openeds="['1', '3']">
      <el-submenu index="1">
        <template slot="title"><i class="el-icon-message"><router-link to="/shu">图书管理</router-link></i></template>
      </el-submenu> 
      <el-submenu index="2">
        <template slot="title"><i class="el-icon-message"><router-link to="">后台管理</router-link></i></template>
      </el-submenu> 
      <el-submenu index="3">
        <template slot="title"><i class="el-icon-message"><router-link to="">国际化</router-link></i></template>
      </el-submenu> 
      <el-submenu index="4">
        <template slot="title"><i class="el-icon-message"><router-link to="">基础表格</router-link></i></template>
      </el-submenu> 
      <el-submenu index="5">
        <template slot="title"><i class="el-icon-message"><router-link to="/tab">tab选项卡</router-link></i></template>
      </el-submenu> 
    </el-menu>
    </el-aside>
    <el-main><router-view></router-view></el-main>
  </el-container>
</el-container>
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'
import screenfull from 'screenfull';

export default {
  name: 'HomeView',
  components: {
    HelloWorld
  },
  data() {
    return {
      fullscreen:false
    }
  },
  methods: {
    fullScreen(){
      if(!screenfull.isEnabled){
        this.$message({
          message:'You browser acn not work',
          type:'warning'
        })
        return false
      }
      screenfull.toggle()
    },
  },
}
</script>
<style>
.el-header{
  background-color: blue;
  color: white;
}
</style>